package qf.index;

import cn.hutool.core.util.NumberUtil;
import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import cn.hutool.json.JSONUtil;

import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;

public class ReadUt {

    public static void main(String[] args) throws SQLException {

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(format.format(new Date()) + " 程序开始了~~~");

        int onePageNum = 1000;
        String limit = "";
//        String limit = " limit 1";

        String newDataName = "scholar_25_01.";
        String summaryTable = newDataName + "pm_ut_aid_info_0120";
        String spiderCnCoreTable = newDataName + "spider_cn_core";
        String spiderCnKiAnalysisTable = newDataName + "spider_cnki_analysis";
        String spiderCqVipAnalysisTable = newDataName + "spider_cqvip_analysis";
        String spiderWanFangAnalysisTable = newDataName + "spider_wanfang_analysis";
        String spiderYiiGleAnalysisTable = newDataName + "spider_yiigle_analysis";
        String pmArticleTable = newDataName + "spider_pubmed_vip_extend";
        String utArticleTable = newDataName + "spider_tb_true_92007022_1125";
        String jourMergeTable = newDataName + "basic_jour_merge";
        String quotaTable = newDataName + "basic_core_paper_quota";
        String basicCoreTable = newDataName + "basic_core_paper";
        String wordAndCodeSetMapTable = newDataName + "word_and_code_set_map";
        String fullAbbrKeyWordTable = newDataName + "full_abbr_key_word_1218";
        String pmOrUtIdTablePm = newDataName + "pm_ut_aid_info_pm";

        // 词（药物，数字代号：1; 基因，数字代号：2; 通路，数字代号：3; 疾病，数字代号：4）和code（1，2，3，4）代码集合。
        Map<String, Set<Integer>> wordAndCodeSetMap = Drug.getWordAndCodeSetMap(wordAndCodeSetMapTable, "id", "word`,`code_set", limit);

        String field = "UT`,`DE`,`TI`,`AB`,`J9`,`SO`,`PM`,`PY`,`C1`,`RP`,`PT`,`DT`,`DI`,`VL`,`IS`,`BP`,`EP`,`FP`,`AB`,`AF`,`LA`,`WC`,`ID`,`EM";
        readUt(utArticleTable, onePageNum, limit, "pid", field, true, 10, summaryTable, wordAndCodeSetMap);

    }


    public static void readUt(String utArticleTable, int onePageNum, String limit, String autoId, String field, boolean print, int allTotal, String summaryTable, Map<String, Set<Integer>> wordAndCodeSetMap) throws SQLException {
        // field = "AB`,`AF`,`AR`,`BP`,`C1`,`DE`,`DI`,`DT`,`EP`,`FU`,`IS`,`J9`,`PD`,`PM`,`PT`,`PY`,`RP`,`SO`,`TI`,`UT`,`VL`,`EM`,`LA`,`WC`,`ID"; // 少了一个LA WC TC AU CR ID，其中TC打算使用自己计算的，AU使用AF，CR也使用自己计算的，是以添加三个：LA`,`WC`,`ID
        Map<Integer, Integer> dataIdAndAidMap = ReadPm.getDataIdAndAidMap(summaryTable, "id", "wos_id");
        System.out.println("dataIdAndAidMap.size(): " + dataIdAndAidMap.size());
        List<Entity> tableNum = Db.use().query("select count(1) as count from " + utArticleTable);
        if (tableNum.get(0).getInt("count") < 1) {
            return;
        }
        Set<String> pinYinSet = PmUnit.getPinYinSet();
        int tableMax = Db.use().queryNumber("select max(" + autoId + ") from " + utArticleTable).intValue();
        Collection<Integer> tableList = new ArrayList<>();
        NumberUtil.appendRange(0, tableMax + onePageNum, onePageNum, tableList);
        AtomicInteger sumNum = new AtomicInteger(0);
        int showNum = Math.max((tableList.size() / allTotal), 1) + (tableList.size() % allTotal);
        AtomicInteger startNum = new AtomicInteger(1);
        tableList.parallelStream().forEach(startId -> {
            try {
                List<Entity> tableData = Db.use().query("select `" + autoId + "`,`" + field + "` from " + utArticleTable + " where " + autoId + " between " + startId + " and " + (startId + onePageNum - 1) + limit);
                if (print && sumNum.getAndIncrement() % showNum == 0) {
//                    System.out.println("\033[31;1m" + format.format(new Date()) + " 读表现在开始：" + startNum.getAndIncrement() + " 总次数：" + allTotal + " 表名：" + utArticleTable + Utils.printMemoryStr() + "\033[0m");
                }
                for (Entity entry : tableData) {
                    Integer dataId = entry.getInt(autoId);
                    String ut = Utils.getStrField(entry, "UT").toUpperCase().replace(" ", "").replace("WOS:", "");
                    if (!dataIdAndAidMap.containsKey(dataId)) {
                        continue;
                    }
                    String keyword = Utils.getStrField(entry, "DE");
                    String title = Utils.getStrField(entry, "TI");
                    String abText = Utils.getStrField(entry, "AB");
                    String j9 = Utils.getStrField(entry, "J9");
                    String so = Utils.getStrField(entry, "SO");
                    int isCns = Utils.is6DaJournals("", "", so, j9);
                    String pm = Utils.getStrField(entry, "PM");
                    int pmId = NumberUtil.isInteger(pm) ? Integer.parseInt(pm.trim()) : 0;
                    String py = Utils.getStrField(entry, "PY");
                    int year = NumberUtil.isInteger(py) ? Integer.parseInt(py.trim()) : 1900;
                    List<En.C1Auth> c1List = new ArrayList<>();
                    boolean isOrder = Utils.getC1ListSort(entry.getStr("C1"), pinYinSet, c1List);
                    List<En.C1Auth> rpList = Utils.getRpListSort(entry.getStr("RP"), isOrder, pinYinSet);
                    List<En.C1Auth> rpChangeC1 = ChangeRp.rpChangeC1(c1List, rpList);
                    String pts = entry.getStr("PT");
                    Set<String> ptSet = new HashSet<>(); // 出版类型
                    if (null != pts && "J".equals(pts.toUpperCase().trim())) {
                        String dt = entry.getStr("DT");
                        if (null != dt && !dt.isEmpty()) {
                            String[] split = dt.split("; ");
                            for (String pt : split) {
                                if (!pt.isEmpty()) {
                                    // 与PubMed的出版类型相对应。
                                    pt = "Editorial Material".equals(pt) ? "Editorial" : pt;
                                    pt = "Article".equals(pt) ? "Journal Article" : pt;
                                    pt = "Meeting-Abstract".equals(pt) ? "Meeting Abstract" : pt;
                                    pt = "News Item".equals(pt) ? "News" : pt;
                                    pt = "Retraction".equals(pt) ? "Retraction of Publication" : pt;
                                    ptSet.add(pt);
                                }
                            }
                        }
                    }
                    String di = Utils.dellEnd(Utils.getStrField(entry, "DI"));
                    String v = entry.getStr("VL");
                    String i = entry.getStr("IS");
                    String b = entry.getStr("BP");
                    String e = entry.getStr("EP");
                    String jour = Utils.toTitleCase((j9.length() > 2 && !j9.endsWith("+") ? j9 : so));
                    // 格式：Anticancer Drugs. 2021 Aug 1;32(7):717-726. doi: 10.1097/CAD.0000000000001050.
                    String info = jour + ". " + (year + ";") + (null == v ? "" : v) + (null == i ? "" : "(" + i + "):") + (null == b ? "" : b) + (null == e || e.isEmpty() ? ". " : "-" + e + ". ") + (di.length() > 6 ? ("doi: " + di + ". ") : "");
                    try {
                        Db.use().update(
                                Entity.create().set("ut", ut).set("pmId", pmId).set("doi", di).set("c1_au", JSONUtil.toJsonStr(c1List)).set("rp_au", JSONUtil.toJsonStr(rpChangeC1)).set("ab", Utils.getStrField(entry, "AB")).set("keyword", strToJson(keyword))
                                        .set("title", title).set("journal", jour).set("year", year).set("is_cns", isCns).set("pt", JSONUtil.toJsonStr(ptSet)).set("auth", strToJson(entry.getStr("AF"))).set("language", Utils.getStrField(entry, "LA"))
                                        .set("subject", strToJson(entry.getStr("WC"))).set("kw_plus", strToCaseJson(entry.getStr("ID"))).set("is_retraction", ReadPm.getIsRetraction(title, ptSet)).set("fund_list", JSONUtil.toJsonStr(getFundList(entry.getStr("FP"))))
                                        .set("drug_gene_pathway_disease", JSONUtil.toJsonStr(Drug.getDrug(title, keyword, abText, wordAndCodeSetMap))).set("mail_list", JSONUtil.toJsonStr(getMail(entry.getStr("EM")))).set("info", Fusion.reInfo(info)),
                                Entity.create(summaryTable).set("id", dataIdAndAidMap.get(dataId)));
                    } catch (SQLException ee) {
                        ee.printStackTrace();
                    }
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        });
        dataIdAndAidMap.clear();
    }

    public static String strToCaseJson(String str) {
        if (null != str && !str.isEmpty()) {
            String[] split = str.split("; ");
            List<String> list = new ArrayList<>();
            for (String s : split) {
                s = s.trim();
                s = s.endsWith(".") ? s.substring(0, s.length() - 1).trim() : s;
                list.add(Utils.toTitleCase(s));
            }
            return JSONUtil.toJsonStr(list);
        }
        return "";
    }

    public static String strToJson(String str) {
        if (null != str && !str.isEmpty()) {
            String[] split = str.split("; ");
            List<String> list = new ArrayList<>();
            for (String s : split) {
                s = s.trim();
                s = s.endsWith(".") ? s.substring(0, s.length() - 1).trim() : s;
                list.add(s);
            }
            return JSONUtil.toJsonStr(list);
        }
        return "";
    }

    // lijinlan@tongji.edu.cn; tianjun@tongji.edu.cn
    public static Set<String> getMail(String mails) {
        Set<String> mailSet = new HashSet<>();
        if (null != mails && mails.contains("@")) {
            String[] split = mails.split(";");
            for (String mail : split) {
                mail = mail.trim();
                if (Utils.fuHeiMail(mail)) {
                    mailSet.add(Utils.dellEnd(mail));
                }
            }
        }
        return mailSet;
    }


    public static List<String> getFundList(String funds) {
        List<String> list = new ArrayList<>();
        if (null != funds && !funds.isEmpty()) {
            String[] split = funds.split("; ");
            Set<String> set = new HashSet<>();
            for (String fund : split) {
                String result = getFund(fund).trim();
                if (!set.contains(result.toLowerCase())) {
                    set.add(result.toLowerCase());
                    list.add(result);
                }
            }
        }
        return list;
    }

    public static String getFund(String fund) {
        // 获取FP字段的基金名称，此与FU字段不同。
        String l = fund.toLowerCase();
        if (l.contains("funding source: ")) {
            return fund.substring(l.indexOf("funding source: ") + "Funding Source: ".length());
        }
        if (l.contains("appeared in source as")) {
            return fund.substring(l.indexOf("appeared in source as") + "appeared in source as".length());
        }
        if (l.contains("appeared in article as")) {
            return fund.substring(l.indexOf("appeared in article as") + "appeared in article as".length());
        }
        fund = fund.replace("（", "(").replace("）", ")").replaceAll(" +", " ").replace(") (", ")(").replace(") )", "))").trim();
        if (fund.contains(")(") && fund.endsWith("))")) {
            return fund.substring(fund.indexOf(")(") + 2, fund.length() - 1);
        }
        if (fund.endsWith(")")) {
            String[] split = fund.split("");
            int left = 0;
            int right = 0;
            int start = 0;
            int end = 0;
            int num = fund.split("\\)").length;
            // Fundamental Research Funds for the Central Universities(Fundamental Research Funds for the Central Universities) 前后的实际上是相等的，只是后面的加的有括号。
            if (num == 1 && fund.split("\\(").length == 2 && fund.endsWith(")") && fund.contains("(")) {
                String front = fund.substring(0, fund.indexOf("(")).trim();
                String ending = fund.substring(fund.indexOf("(") + 1, fund.length() - 1).trim();
                if (front.equalsIgnoreCase(ending)) {
                    return front;
                }
            }
            for (int i = 0; i < split.length; i++) {
                String s = split[i];
                if ("(".equals(s)) {
                    left++;
                    start = start == 0 ? i : start;
                }
                if (")".equals(s)) {
                    right++;
                    end = i;
                }
                if (left > num && left == right) {
                    String result = fund.substring(start + 1, end);
                    if (result.contains("(") && result.endsWith(")")) {
                        String substring = result.substring(result.indexOf("("));
                        if (!Pattern.compile("[a-z]").matcher(substring).find()) {
                            return result;
                        }
                    } else {
                        return result;
                    }
                }
            }
        }
        return fund;
    }

    // 获取C1的单位信息，如果存在重复，给予删除，且仍保留原来的顺序。
//    public static Set<String> getC1AuthUnitListqqqqqqqqqqqqqqqqqqqqqqq(String c1, List<En.MethodAndInfo> c1AuthUnitList) {
//        Set<String> authSet = new HashSet<>();
//        if (null != c1 && c1.length() > 6) {
//            c1 = c1.replace("；", "; ").replaceAll(" +", " ").trim();
//            String[] split = (c1.contains("; [") || c1.contains("] ")) ? c1.split("; \\[") : c1.split("; ");
//            for (String original : split) {
//                String unit = original.indexOf("] ") > 0 ? original.substring(original.indexOf("] ") + "] ".length()).trim() : original.trim();
//                unit = unit.endsWith(".") ? unit.substring(0, unit.length() - ".".length()).trim() : unit.trim();
//                String auths = original.indexOf("] ") > 0 ? original.substring(0, original.indexOf("] ") + "] ".length()).trim() : original.trim();
//                auths = auths.endsWith("]") ? auths.substring(0, auths.length() - "]".length()).trim() : auths.trim();
//                auths = auths.startsWith("[") ? auths.substring("[".length()).trim() : auths.trim();
//                auths = auths.endsWith(".") ? auths.substring(0, auths.length() - ".".length()).trim() : auths.trim();
//                En.MethodAndInfo c1AuthUnit = new En.MethodAndInfo();
//                c1AuthUnit.setInfo(auths);
//                c1AuthUnit.setName(unit);
//                c1AuthUnitList.add(c1AuthUnit);
//                String[] authSplit = auths.split("; ");
//                for (String auth : authSplit) {
//                    if (auth.length() > 3) {
//                        authSet.add(auth.trim());
//                    }
//                }
//            }
//        }
//        return authSet;
//    }

    public static Set<String> getC1AuthUnitList(String c1, List<En.MethodAndInfo> c1AuthUnitList) {
        // 获取C1的单位信息，如果存在重复，给予删除，且仍保留原来的顺序。2024.12.11发现有超长的unit信息，即同一个作者在多个单位，WOS:000978358600001，现已改进。
        Set<String> authSet = new HashSet<>();
        if (null != c1 && c1.length() > 6) {
            c1 = c1.replace("；", "; ").replaceAll(" +", " ").trim();
            String[] split = (c1.contains("; [") || c1.contains("] ")) ? c1.split("; \\[") : c1.split("; ");
            for (String original : split) {
                String units = original.indexOf("] ") > 0 ? original.substring(original.indexOf("] ") + "] ".length()).trim() : original.trim();
                units = units.endsWith(".") ? units.substring(0, units.length() - ".".length()).trim() : units.trim();
                String auths = original.indexOf("] ") > 0 ? original.substring(0, original.indexOf("] ") + "] ".length()).trim() : original.trim();
                auths = auths.endsWith("]") ? auths.substring(0, auths.length() - "]".length()).trim() : auths.trim();
                auths = auths.startsWith("[") ? auths.substring("[".length()).trim() : auths.trim();
                auths = auths.endsWith(".") ? auths.substring(0, auths.length() - ".".length()).trim() : auths.trim();
                if (units.contains("; ")) {
                    String[] unitList = units.split("; ");
                    for (String unit : unitList) {
                        En.MethodAndInfo c1AuthUnit = new En.MethodAndInfo();
                        c1AuthUnit.setInfo(auths);
                        c1AuthUnit.setName(unit);
                        c1AuthUnitList.add(c1AuthUnit);
                    }
                } else {
                    En.MethodAndInfo c1AuthUnit = new En.MethodAndInfo();
                    c1AuthUnit.setInfo(auths);
                    c1AuthUnit.setName(units);
                    c1AuthUnitList.add(c1AuthUnit);
                }
                String[] authSplit = auths.split("; ");
                for (String auth : authSplit) {
                    if (auth.length() > 3) {
                        authSet.add(auth.trim());
                    }
                }
            }
        }
        return authSet;
    }

//    public static List<En.C1AuthUnit> getUtSortAuthList(String c1, Set<String> pinYinSet, Map<String, String> wordAndStandardMap, Set<String> enDeptSet, Map<String, Integer> deptAndSumMap) {
//        List<En.C1AuthUnit> c1AuthUnitList = new ArrayList<>();
//        // Chang-Ming Huang -> isOrder = ture 统一使用：Huang ChangMing
//        if (null != c1 && c1.length() > 3) {
//            List<En.MethodAndInfo> authUnitList = new ArrayList<>();
//            Set<String> authSet = getC1AuthUnitList(c1, authUnitList);
//            boolean isOrder = BasisTable.getPiYiOrder(CollUtil.join(authSet, "; "), pinYinSet);
//            for (En.MethodAndInfo methodAndInfo : authUnitList) {
//                String auths = methodAndInfo.getInfo();
//                String unit = methodAndInfo.getName();
//                Set<String> unitSet = ReadUnit.getOneC1Dept(unit, "ut", wordAndStandardMap, enDeptSet, deptAndSumMap);
////                Set<String> unitSet = ReadUnit.getOneC1(unit, "ut", wordAndStandardMap);
//                String[] split = auths.split("; ");
//                for (String original : split) {
//                    String auth = original;
//                    if (isOrder && original.lastIndexOf(" ") > 0) {
//                        String end = original.substring(0, original.lastIndexOf(" "));
//                        String start = original.substring(original.lastIndexOf(" "));
//                        // 部分英文作者的名称，可能有单个字母的，不给予转换。
//                        if (end.length() > 1 && start.length() > 1) {
//                            auth = start + " " + end;
//                        }
//                    }
//                    String sortAuth = BasisTable.changeAuthOrder(auth, pinYinSet);
//                    En.C1AuthUnit c1AuthUnit = new En.C1AuthUnit();
//                    c1AuthUnit.setInfo(original + "; " + unit);
//                    c1AuthUnit.setAuth(sortAuth);
//                    c1AuthUnit.setUnitList(new ArrayList<>(unitSet));
//                    c1AuthUnitList.add(c1AuthUnit);
//                }
//            }
//        }
//        return c1AuthUnitList;
//    }

    /*
      Article|56532223
      Meeting Abstract|9391605
      Proceedings Paper|8561725
      Book Review|4673890
      Editorial Material|3828139
      Review|2891072
      Letter|2636930
      Note|1471438
      Early Access|1324116
      Book Chapter|1278949
      News Item|606161
      Correction|431480
      Poetry|301793
      Biographical-Item|152777
      Correction, Addition|146902
      Art Exhibit Review|126981
      Book|93580
      Item About an Individual|88275
      Discussion|80423
      Record Review|79369
      Film Review|73504
      Music Performance Review|70953
      Fiction, Creative Prose|51000
      Theater Review|35583
      Dance Performance Review|26683
      Retraction|20296
      Reprint|18454
      Music Score Review|18433
      Software Review|15749
      Data Paper|14437
      Bibliography|13780
      Abstract of Published Item|13433
      TV Review, Radio Review|10305
      Retracted Publication|7599
      Excerpt|7496
      TV Review, Radio Review, Video|4752
      Meeting|2955
      Script|2785
      Hardware Review|2594
      Database Review|1535
      Chronology|1210
      Music Score|1164
      Expression of Concern|1057
      Item Withdrawal|308
      Withdrawn Publication|102
      Main Cite|99
      Publication with Expression of Concern|46
      Meeting Summary|25
      Press Digest|3
      Meeting-Abstract|1
     */

    /*
      CREATE TABLE `pm_ut_aid_info_ut` (
        `id` int(10) NOT NULL AUTO_INCREMENT,
        `key_word_list` longtext COMMENT '关键词集合，此是基于标题、摘要、关键词三处的整合',
        `pm_ut_doi_list` text COMMENT 'pm、doi、ut三者的集合，用于童工的ES检索',
        `journal` text COMMENT '期刊的名称',
        `aid` int(9) DEFAULT NULL COMMENT '因与原表字段重名，pid改为aid，论文的唯一主键，使用老鲍的论文基础表中的自增主键',
        `citation_quota` double DEFAULT NULL COMMENT '引文的质量（按中科院分区表）',
        `reference_quota` double DEFAULT NULL COMMENT '参文的质量',
        `ti_key` text COMMENT '从标题中提取的关键词',
        `ab_key` longtext COMMENT '从摘要中提取的关键词',
        `kw_key` longtext COMMENT '从关键词中提取的关键词(若是主题词给予转换)',
        `abb_word` longtext COMMENT '从简写中提取出来的关键词（是一对）',
        `zky_dalei` int(1) DEFAULT NULL COMMENT '中科院的期刊分区表最佳的大类',
        `jcr_if` double DEFAULT NULL COMMENT 'jcr(scie)期刊影响因子',
        `year` int(4) DEFAULT NULL COMMENT '论文的出版年',
        `title` text COMMENT '论文的原始标题',
        `keyword` longtext COMMENT '论文的原始关键词',
        `ab` longtext COMMENT '论文的原始摘要',
        `mesh` text COMMENT 'PubMed的主题词表，含主题词和副主题词',
        `jid` int(9) DEFAULT NULL COMMENT '期刊的唯一id号，此为期刊关联表的自增主键',
        `discussion` longtext COMMENT '摘要提取出来的特定字段',
        `results` longtext COMMENT '摘要提取出来的特定字段',
        `methods` longtext COMMENT '摘要提取出来的特定字段',
        `background` longtext COMMENT '摘要提取出来的特定字段',
        `c1_list` longtext COMMENT 'wos表中的c1或PubMed表中的作者单位信息字段，只保留单位信息',
        `c1_unit_list` longtext COMMENT '从c1中提取出来的单位信息',
        `rp_list` longtext COMMENT 'wos表中的rp字段，只保留单位信息',
        `rp_unit_list` longtext COMMENT '从rp中提取出来的单位信息',
        `cite` longtext COMMENT '参文格式（NLM、APA、MLA、AMA四种）',
        `cn_ti` text COMMENT '中文的文献标题',
        `cn_ab` longtext COMMENT '中文的文献摘要',
        `cn_kw` longtext COMMENT '中文的文献关键词',
        `cn_type` text COMMENT '中文的文献的类型，综述等',
        `pt` text COMMENT '英文的文献的类型，综述等，是一个集合',
        `cn_country` text COMMENT '中文的发文的国家，区分第一或通讯以及其它的，此为非第一或通讯',
        `cn_unit` longtext COMMENT '中文的发文的机构，区分第一或通讯以及其它的，此为非第一或通讯',
        `is_cns` int(1) DEFAULT NULL COMMENT '六大顶级刊，是为1，否为0',
        `cn_fund` longtext COMMENT '中文的基金的名称',
        `cn_country_1` text COMMENT '中文的发文的国家，区分第一或通讯以及其它的，此为第一或通讯',
        `cn_unit_1` text COMMENT '中文的发文的机构，区分第一或通讯以及其它的，此为第一或通讯',
        `pmId` int(8) DEFAULT NULL COMMENT '最大8位的pmId号',
        `ut` varchar(15) DEFAULT NULL COMMENT '此为15位的UT号',
        `doi` text COMMENT 'doi号集合',
        `nlmId` varchar(25) DEFAULT NULL COMMENT 'nlmId号，无其它字符',
        `cite_score` double DEFAULT NULL COMMENT '期刊citeScore影响因子值',
        `jcr_quartile` int(1) DEFAULT NULL COMMENT 'jcr(scie)期刊分区',
        `fund` longtext COMMENT '来自wos的基金名称(FU字段)',
        `fund_list` longtext COMMENT '从原始基金信息中提供出来的基金名称，待规范。',
        `method_info` longtext COMMENT '摘要提取出来的特定字段集合',
        `trans_ok` int(1) DEFAULT NULL COMMENT '翻译完成为1，没有完成为0',
        `drug_gene_pathway_disease` longtext COMMENT '药物、基因、通路、疾病',
        `auth` longtext COMMENT '原始的作者信息，全写',
        `sort_auth` longtext COMMENT 'Chang-Ming Huang  英文名字中，新志贾这类属于正序，反之贾新志这类属于反序，程序默认为正序转反序，如果是反序则不用再转换了。',
        `info` longtext COMMENT '备用字段',
        `is_retraction` int(1) DEFAULT NULL COMMENT '是否是撤稿，是为1，否为0；',
        `is_china` int(1) DEFAULT NULL COMMENT '是否是中国人发表的，是为1，否为0；',
        `cn_discussion` longtext COMMENT '中文摘要提取出来的特定字段',
        `cn_results` longtext COMMENT '中文摘要提取出来的特定字段',
        `cn_methods` longtext COMMENT '中文摘要提取出来的特定字段',
        `cn_background` longtext COMMENT '中文摘要提取出来的特定字段',
        PRIMARY KEY (`id`),
        KEY `aid` (`aid`),
        KEY `pmId` (`pmId`),
        KEY `ut` (`ut`),
        KEY `jid` (`jid`),
        KEY `trans_ok` (`trans_ok`)
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
     */

}
